import QtQuick 2.15
import QtQuick.Window 2.15
import QtQuick.Controls 2.15
import QtQuick.Layouts 1.15
import FluentUI 1.0

FluLauncher {
    id: app
    Connections {
        target: FluTheme
        function onDarkModeChanged() {
            SettingsHelper.saveDarkMode(FluTheme.darkMode)
        }
    }
    Connections {
        target: FluApp
        function onUseSystemAppBarChanged() {
            SettingsHelper.saveUseSystemAppBar(FluApp.useSystemAppBar)
        }
    }
    Component.onCompleted: {
        FluApp.init(app)
        FluApp.useSystemAppBar = true
        FluApp.windowIcon = "qrc:/res/icon/app.ico"
        FluTheme.animationEnabled = true
        FluTheme.nativeText = true
        FluRouter.routes = {
            "/": "qrc:/qml/MainWindow.qml",
            "/login": "qrc:/qml/LoginWindow.qml",
            "/pageWindow": "qrc:/qml/PageWindow.qml",
            "/about": "qrc:/qml/AboutWindow.qml"
        }

        FluRouter.navigate("/login")
    }
}
